{% extends "base.html" %}
{% load shop_currency %}

{% block content %}
<div id="product-detail">
    <h2>{% block title %}{{ product.name }}{% endblock %}</h2>

    <div class="description">
        {{ product.description|linebreaks }}
    </div>
    <br/>
    {% include "ratings.html" %}
    <br/>
    <div class="price">{{ product.price|currency }}</div>
    <div class="stock">
        {% if product.stock > 0 %}
            {{ product.stock }} in stock
        {% else %}
            Out of stock
        {% endif %}
    </div>
    <form class="buy" method="post" action="{% url shop.views.cart.add product.id %}">
        {% csrf_token %}
        <div><input type="submit" value="Add to Cart"/></div>
        <div><input type="hidden" name="next" value="{{ request.get_full_path }}"/></div>
    </form>
    <br/>
    {% include "comments.html" %}
</div>
{% endblock %}

{% block scripts %}
{{ block.super }}
<script type="text/javascript" src="{{ MEDIA_URL}}js/ratings.js"></script>
{% endblock %}

